ALTER TABLE Sach ADD CONSTRAINT Sach_01 FOREIGN KEY(NhaCungCap) REFERENCES NhaCungCap(MaNhaCungCap);
ALTER TABLE ChiTietHoaDon ADD CONSTRAINT CTHD_01 FOREIGN KEY(MaHoaDon) REFERENCES HoaDon(MaHoaDon);
ALTER TABLE ChiTietHoaDon ADD CONSTRAINT CTHD_02 FOREIGN KEY(MaSach) REFERENCES Sach(MaSach);
ALTER TABLE HoaDon ADD CONSTRAINT HD_01 FOREIGN KEY(MaNhanVien) REFERENCES NhanVien(MaNV);
ALTER TABLE ChiTietPhieuNhap ADD CONSTRAINT CTPN_01 FOREIGN KEY(MaPhieuNhap) REFERENCES PhieuNhap(MaPhieuNhap);
ALTER TABLE ChiTietPhieuNhap ADD CONSTRAINT CTPN_02 FOREIGN KEY(MaSach) REFERENCES Sach(MaSach);
ALTER TABLE PhieuNhap ADD CONSTRAINT PN_01 FOREIGN KEY(MaNV) REFERENCES NhanVien(MaNV);
ALTER TABLE SachNhaXuatBan ADD CONSTRAINT SNXB_01 FOREIGN KEY(MaSach) REFERENCES Sach(MaSach);
ALTER TABLE SachNhaXuatBan ADD CONSTRAINT SNXB_02 FOREIGN KEY(MaNhaXuatBan) REFERENCES NhaXuatBan(MaNhaXuatBan);
ALTER TABLE SachTacGia ADD CONSTRAINT STG_01 FOREIGN KEY(MaSach) REFERENCES Sach(MaSach);
ALTER TABLE SachTacGia ADD CONSTRAINT STG_02 FOREIGN KEY(MaTacGia) REFERENCES TacGia(MaTacGia);
ALTER TABLE SachTheLoai ADD CONSTRAINT STL_01 FOREIGN KEY(MaSach) REFERENCES Sach(MaSach);
ALTER TABLE SachTheLoai ADD CONSTRAINT STL_02 FOREIGN KEY(MaTheLoai) REFERENCES TheLoai(MaTheLoai);
DROP TRIGGER TGS_01
DROP TRIGGER TGCHITIETPHIEUNHAP_01